﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PCR.Base
{
    /// <summary>
    /// Provide all the calculation methods for whole application
    /// </summary>
    public interface ICalculator
    {
        /// <summary>
        /// Get the standard curve param from the the sample data
        /// The sample data count must more than 2
        /// </summary>
        /// <returns>null if the data is not correct </returns>
        IStdCurveParam GetStdParamFromSampleData(IList<IStdSampleData> samples);

        /// <summary>
        /// Get the patient's virus revised CT by 
        /// patient virus parameter, standard curve parameter, virus type parameter
        /// </summary>
        /// <param name="patientVirus">Patient virus data</param>
        /// <param name="curveParam">Standard curve parameter</param>
        /// <param name="virusType">Virus type parameter</param>
        /// <param name="virusType">Pass out the patient's revised virus</param>
        /// <returns>true if successfully, false if failed</returns>
        bool GetVirusRevisedCT(IPatientVirus patientVirus, IStdCurveParam curveParam,
            IVirusType virusType, out double revisedCT);

        /// <summary>
        /// Get the patient's virus exponent by 
        /// patient virus parameter, standard curve parameter, virus type parameter
        /// </summary>
        /// <param name="patientVirus">Patient virus data</param>
        /// <param name="curveParam">Standard curve parameter</param>
        /// <param name="virusType">Virus type parameter</param>
        /// <param name="virusType">Pass out the patient's virus exponent</param>
        /// <returns>true if successfully, false if failed</returns>
        bool GetVirusExponent(IPatientVirus patientVirus, IStdCurveParam curveParam, 
            IVirusType virusType, out double exponent);

        /// <summary>
        /// Get the revised CT by the standard curve parameter
        /// </summary>
        /// <param name="kVal">Standard curve K value</param>
        /// <param name="bVal">Standard curve B value</param>
        /// <param name="cellCount">Cell count</param>
        /// <param name="revisedCT">Passed out revised CT value</param>
        /// <returns>true if OK, false if failed</returns>
        double GetRevisedCT(double kVal, double bVal, double cellCount);
    }
}
